import { takeEvery, put } from 'redux-saga/effects' 
import axios from 'axios'

import {GET_MY_LIST} from './actionTypes'
import {getListAction} from './actionCreators'

function* mySaga() {
    yield takeEvery(GET_MY_LIST, getList)
}

function* getList(){
    const res = yield axios.get('https://www.fastmock.site/mock/511d49a8b196ded4fbff181c27ef8ca2/xiaojiejie/getList')
    const action = getListAction(res.data)
    yield put(action)
}

export default mySaga;